import { defineConfig } from 'vite'
import uni from '@dcloudio/vite-plugin-uni'
import { resolve } from 'path'

export default defineConfig(() => {
    return {
        base: './',
        build: {
            minify: true,
            outDir: 'dist',
        },
        server: {
            port: '80'
        },
        plugins: [
            uni()
        ],
        resolve: {
            alias: {
                '@': resolve(__dirname, 'src'),
                'uview-plus': 'uview-plus'
            }
        },
        exclude: [
            /\/README\.md$/,
        ],
        css: {
            preprocessorOptions: {
                scss: {
                    api: 'modern-compiler',
                    additionalData: `@import "uview-plus/theme.scss";`
                }
            }
        }
    }
})